/**
 * 组件，需添加组件请移步 src/components
 * @author luguoxiang
 * @date 2021-09-07
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
// 组件
import { h, defineAsyncComponent } from 'vue';
import { Icon } from 'tdesign-icons-vue-next';

// export * from './LgAuth';
export * from './LgButtonList';
export * from './LgTable';
/* export const LgAuth = defineAsyncComponent(() => import('@/soar/components/LgAuth/index.vue'));
export const LgAutoComplete = defineAsyncComponent(() => import('@/soar/components/LgAutoComplete/index.vue'));
export const LgRangeDate = defineAsyncComponent(() => import('@/soar/components/LgRangeDate/index.vue'));
export const LgRangeTime = defineAsyncComponent(() => import('@/soar/components/LgRangeTime/index.vue'));
export const LgDict = defineAsyncComponent(() => import('@/soar/components/LgDict/index.vue'));
export const LgBizSelect = defineAsyncComponent(() => import('@/soar/components/LgBizSelect/index.vue'));
export const LgPicker = defineAsyncComponent(() => import('@/soar/components/LgPicker/index.vue'));
export const LgBizTree = defineAsyncComponent(() => import('@/soar/components/LgBizTree/index.vue'));
export const LgUpload = defineAsyncComponent(() => import('@/soar/components/LgUpload/index.vue'));
export const LgSwitch = defineAsyncComponent(() => import('@/soar/components/LgSwitch/index.vue'));
export const LgCountdown = defineAsyncComponent(() => import('@/soar/components/LgCountdown/index.vue'));
export const LgFormat = defineAsyncComponent(() => import('@/soar/components/LgFormat/index.vue'));
export const LgText = defineAsyncComponent(() => import('@/soar/components/LgText/index.vue'));
export const LgAutoSize = defineAsyncComponent(() => import('@/soar/components/LgAutoSize/index.vue'));
export const LgGrid = defineAsyncComponent(() => import('@/soar/components/LgGrid/index.vue'));
export const LgModal = defineAsyncComponent(() => import('@/soar/components/LgModal/index.vue'));
export const LgDrawer = defineAsyncComponent(() => import('@/soar/components/LgDrawer/index.vue'));
export const LgDescription = defineAsyncComponent(() => import('@/soar/components/LgDescription/index.vue'));
export const LgForm = defineAsyncComponent(() => import('@/soar/components/LgForm/index.vue'));
export const LgSearchBar = defineAsyncComponent(() => import('@/soar/components/LgSearchBar/index.vue'));
export const LgCollapse = defineAsyncComponent(() => import('@/soar/components/LgCollapse/index.vue'));
// export const LgCodeEditor = defineAsyncComponent(() => import('@/soar/components/LgCodeEditor/index.vue')); */

/**
 * 图标组件
 * @param props
 * @constructor
 */
export const LgIcon = (props: { value: string }) => {
  const { value } = props;
  if (!value) {
    return h('i');
  }
  if (typeof value === 'object' && value) {
    return h(value);
  }
  if (value.startsWith('class:')) {
    return h('i', { class: value.substring(6) });
  }
  if (value.startsWith('img:')) {
    return h('img', { src: value.substring(4) });
  }
  if (/^(http|https):\/\/([\w.]+\/?)\S*$/.test(value)) {
    return h('img', { src: value });
  }
  return h(Icon, { name: value });
};
export { default as LgAuth } from '@/soar/components/LgAuth/index.vue';
export { default as LgAutoComplete } from '@/soar/components/LgAutoComplete/index.vue';
export { default as LgRangeDate } from '@/soar/components/LgRangeDate/index.vue';
export { default as LgRangeTime } from '@/soar/components/LgRangeTime/index.vue';
export { default as LgDict } from '@/soar/components/LgDict/index.vue';
export { default as LgBizSelect } from '@/soar/components/LgBizSelect/index.vue';
export { default as LgPicker } from '@/soar/components/LgPicker/index.vue';
export { default as LgBizTree } from '@/soar/components/LgBizTree/index.vue';
export { default as LgUpload } from '@/soar/components/LgUpload/index.vue';
export { default as LgSwitch } from '@/soar/components/LgSwitch/index.vue';
export { default as LgCountdown } from '@/soar/components/LgCountdown/index.vue';
export { default as LgFormat } from '@/soar/components/LgFormat/index.vue';
export { default as LgText } from '@/soar/components/LgText/index.vue';
export { default as LgAutoSize } from '@/soar/components/LgAutoSize/index.vue';
export { default as LgGrid } from '@/soar/components/LgGrid/index.vue';
export { default as LgModal } from '@/soar/components/LgModal/index.vue';
export { default as LgDrawer } from '@/soar/components/LgDrawer/index.vue';
export { default as LgDescription } from '@/soar/components/LgDescription/index.vue';
export { default as LgForm } from '@/soar/components/LgForm/index.vue';
export { default as LgSearchBar } from '@/soar/components/LgSearchBar/index.vue';
export { default as LgCollapse } from '@/soar/components/LgCollapse/index.vue';
// export { default as LgCodeEditor } from '@/soar/components/LgCodeEditor/index.vue';
